﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Axis.Web.Administrator.Global;
using System.Web.Script.Serialization;
using Axis.Dao.Layout;
using Axis.BusinessObject.Layout;
using Axis.BusinessObject.Core;

namespace Axis.Web.Views.Banner
{
    public class CBannerUI: System.Web.UI.Page
    {
        public string GetList(string CategoryID)
        {

            var MEMBER_ID = 0;
            var member = new CMemberList();
            if (Session["MEMBERINFO"] != null)
            {
                member = Session["MEMBERINFO"] as CMemberList;
                MEMBER_ID = member.ID;
            }

            CLayoutDao core = new CLayoutDao();
            IList<CComponent> Map = core.GetComponent(string.Format("<InputValue MEMBER=\"{0}\" CategoryID=\"{1}\" Context =\"FRONTEND\"/>", MEMBER_ID, CategoryID));
            JavaScriptSerializer js = new JavaScriptSerializer();
            return js.Serialize(Map);
        }
        public string GetListReceiveGift(string CategoryID)
        {

            var MEMBER_ID = 0;
            var member = new CMemberList();
            if (Session["MEMBERINFO"] != null)
            {
                member = Session["MEMBERINFO"] as CMemberList;
                MEMBER_ID = member.ID;
            }

            CLayoutDao core = new CLayoutDao();
            IList<CComponent> Map = core.GetComponent(string.Format("<InputValue MEMBER=\"{0}\" CategoryID=\"{1}\" Context =\"GIFTBLOCK_FRONT\"/>", MEMBER_ID, CategoryID));
            JavaScriptSerializer js = new JavaScriptSerializer();
            return js.Serialize(Map);
        }
    }
}